home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_07_03
/
v7n3079a.txt
< prev
next >
Wrap
Text File
|
1989-01-17
|
990b
|
37 lines
class Newt : public Frog {
public:
Newt( char *n) : (n) {}
void jump( int x)
{
printf( "I'm a jumping Newt\n" );
// invoke base class function against
// this derived class object
Frog::jump( x);
}
};
class Toad : public Frog {
public:
Toad( char *n) : (n) {}
void jump( int x)
{
printf( "I'm a jumping Toad\n" );
Frog::jump( x);
}
};
class Salamander : public Frog {
public:
Salamander( char *n) : (n) {}
void jump( int x)
{
printf( "I'm a jumping Salamander\n" );
Frog::jump( x);
}
};